package com.wd.common.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding
import com.gyf.immersionbar.ImmersionBar

/**
 * 作者:孙殿彭 by mac on2023/9/4 21:17
 * 类注释:
 */
abstract class BaseActivity<T : ViewBinding, U> : AppCompatActivity() {
    private lateinit var _binding: T
    protected val binding get() = _binding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        _binding = getViewBinding()
        setContentView(_binding.root)
        initData()
        //沉浸式
        ImmersionBar.with(this)
            .statusBarAlpha(0.4f).init()

    }

    protected abstract fun getViewBinding(): T
    protected abstract fun initData()


}